async function formatCourseRecordData(rawData) {
    const formattedData = await Promise.all(rawData.map(async entry => {
        const course = entry['1']; // 获取课程信息对象
        console.log('course')
        console.log(course)
        const formattedCourse = {
            surriculumSystem: course['surriculumSystem'],
            courseNumber: course['courseNumber'],
            courseName: course['courseName'],
            courseNature: course['courseNature'],
            courseAttribute: course['courseAttribute'],
            credit: Number(course['credit']), // 将BigInt转换为数字
            contactHour: Number(course['contactHour']), // 将BigInt转换为数字
            semesterOffered: Number(course['semesterOffered']), // 将BigInt转换为数字
            gradeScale: Number(course['gradeScale']), // 将BigInt转换为数字
            reviewerAddr: entry['reviewerAddr'],
            status: Number(entry['2']), // 将BigInt转换为数字
            completionTime: Number(entry['completionTime']), // 将BigInt转换为数字
            courseScore: Number(entry['courseScore']), // 将BigInt转换为数字
            examScore: Number(entry['examScore']), // 将BigInt转换为数字
            totalScore: Number(entry['totalScore']), // 将BigInt转换为数字
            //学生信息结构体
            realName: entry['realName'], //
            idNumber: entry['idNumber'], //
            studentIDNumber: entry['studentIDNumber'], //
            educationalLevel: Number(entry['educationalLevel']), //
            gradeLevel: Number(entry['gradeLevel']), //
            classNumber: entry['classNumber']

        };

        return {
            ...formattedCourse // 将课程信息属性展开到同一级
        };
    }));
    return formattedData;
}

module.exports = {
    formatCourseRecordData
};
